/**
 * 执行的jvm参数：-verbose:gc -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8
 */
public class GarbageCollection {
    public static final int ONEMB = 1024 * 1024;

    public static void testAllocation() {
        byte[] allocation1, allocation2, allocation3, allocation4;

        allocation1 = new byte[2 * ONEMB];
        allocation2 = new byte[2 * ONEMB];
        allocation3 = new byte[2 * ONEMB];
        allocation4 = new byte[4 * ONEMB];
        System.out.println("OK!");
    }


    public static void main(String[] args) {
    	for(String arg : args){
    		System.out.println(arg);
    	}
        GarbageCollection.testAllocation();
        while(true){
//        	testAllocation();
        }
    }
}